{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fswiss\fprq0\fcharset0 Microsoft Sans Serif;}{\f5\fswiss\fprq2\fcharset128 Microsoft Sans Serif;}{\f6\fswiss\fprq2\fcharset0 Arial Unicode MS;}{\f7\fnil\fprq2\fcharset0 MS Mincho;}{\f8\fnil\fprq0\fcharset0 Tahoma;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
{\stylesheet{\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\snext1 Normal;}
{\s2\sb240\sa120\keepn\rtlch\af2\afs28\lang255\ltrch\dbch\af7\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext3 Heading;}
{\s3\sa120\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext3 Body Text;}
{\s4\sa120\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon3\snext4 List;}
{\s5\sb120\sa120\rtlch\af8\afs24\lang255\ai\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext5 caption;}
{\s6\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext6 Index;}
{\s7\sb120\sa120\rtlch\afs24\lang255\ai\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext7 caption;}
{\*\cs9\cf0\rtlch\af0\afs24\lang255\ltrch\dbch\af0\langfe255\hich\f0\fs24\lang1033\loch\f0\fs24\lang1033 RTF_Num 2 1;}
{\*\cs10\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 Numbering Symbols;}
}{\*\listtable{\list\listtemplateid1
{\listlevel\levelnfc0\leveljc0\levelstartat1\levelfollow0{\leveltext \'02\'00.;}{\levelnumbers\'01;}\fi-360\li360}{\listname RTF_Num 2;}\listid1}
}{\listoverridetable{\listoverride\listid1\listoverridecount0\ls0}}

{\info{\creatim\yr2011\mo7\dy27\hr7\min21}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3000}}\deftab709
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}
{\*\pgdscno0}\paperh15840\paperw12240\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \ltrpar\s1\ql\rtlch\af4\afs24\lang255\ab\ltrch\dbch\af4\langfe255\hich\f5\fs24\lang1033\b\loch\f5\fs24\lang1033\b {\rtlch \ltrch\loch\f5\fs24\lang1033\i0\b Input Handling}
\par \pard\plain \ltrpar\s1\ql\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\af4\afs20\lang255\ltrch\dbch\af4\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 This sample shows how to setup a basic input trigger system that respond to keyboard inputs to move an object around on the screen. The current state of the mouse and keyboard can be queried from the {\rtlch\ltrch\hich\b\loch\b Mouse} and {\rtlch\ltrch\hich\b\loch\b Keyboard} static classes. These classes require
 that the proper mouse/keyboard services be registered with the engine and are nothing more than a means to query the underlying input wrapper object. Future input devices, such as gamepads and joysticks will follow this organization.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch  }{\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 In addition to this functionality, the engine offers a high level input system that is based on the concept of triggers. A collection of input triggers is an {\rtlch\ltrch\hich\b\loch\b InputLayer}, where each trigger is composed of two objects:}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain {\listtext\pard\plain \li360\ri0\lin360\rin0\fi-360\f5\fs20\f4\f4\fs20 1.\tab}\ilvl0 \ltrpar\s1\ls0\li360\ri0\lin360\rin0\fi-360\ql\rtlch\af4\afs20\lang255\ltrch\dbch\af4\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch  }{\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 An {\rtlch\ltrch\hich\b\loch\b InputCondition}, that checks if a condition has been met or not, such as if a key has been pressed or not.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch  }{\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 An {\rtlch\ltrch\hich\b\loch\b InputAction}, that is triggered if the condition as been met.}
\par \pard\plain \ltrpar\s1\ql\rtlch\af4\afs20\lang255\ltrch\dbch\af4\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 Each of these two objects can either be subclassed or used directly by passing an anonymous method (delegate) to their constructors.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch  }{\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 The advantage for dividing up an input trigger into these two objects allows you to re-use them. For example, the engine implements a {\rtlch\ltrch\hich\b\loch\b KeyPressedCondition} that checks if a certain key has been pressed, and to allow for repeats. This is a very common logic 
that often appears in numerous places in your code, so it makes sense to encapsulate it into an object that you can re-use. Additionally, the input condition is separated from its action allowing either logic to change without affecting the other, which ca
n make keymapping easier to handle.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 Each trigger or input layer can be enabled/disabled, and you can group common input triggers into different input layers. For example, a pause screen that should disable gameplay, but enable the mouse for menu selection. This can easily be implemented with
 two input layers, that you disable/enable as a whole unit as your game changes its state.}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs24\lang1033\loch\f5\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 Note: This sample disables the FPS controls (both mouse and WSAD controls). Instead, the WSAD keys control the object on the screen.}
\par }